3.429 \(\int \frac{(d+e x^r) (a+b \log (c x^n))^2}{x} \, dx\)

Optimal. Leaf size=80 \[ \frac{d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac{2 b e n x^r \left (a+b \log \left (c x^n\right )\right )}{r^2}+\frac{e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac{2 b^2 e n^2 x^r}{r^3} \]

[Out]

(2*b^2*e*n^2*x^r)/r^3 - (2*b*e*n*x^r*(a + b*Log[c*x^n]))/r^2 + (e*x^r*(a + b*Log[c*x^n])^2)/r + (d*(a + b*Log[
c*x^n])^3)/(3*b*n)

________________________________________________________________________________________

Rubi [A]  time = 0.139085, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {2353, 2302, 30, 2305, 2304} \[ \frac{d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\frac{2 b e n x^r \left (a+b \log \left (c x^n\right )\right )}{r^2}+\frac{e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac{2 b^2 e n^2 x^r}{r^3} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^r)*(a + b*Log[c*x^n])^2)/x,x]

[Out]

(2*b^2*e*n^2*x^r)/r^3 - (2*b*e*n*x^r*(a + b*Log[c*x^n]))/r^2 + (e*x^r*(a + b*Log[c*x^n])^2)/r + (d*(a + b*Log[
c*x^n])^3)/(3*b*n)

Rule 2353

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 2302

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps

\begin{align*} \int \frac{\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx &=\int \left (\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x}+e x^{-1+r} \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=d \int \frac{\left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx+e \int x^{-1+r} \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=\frac{e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac{d \operatorname{Subst}\left (\int x^2 \, dx,x,a+b \log \left (c x^n\right )\right )}{b n}-\frac{(2 b e n) \int x^{-1+r} \left (a+b \log \left (c x^n\right )\right ) \, dx}{r}\\ &=\frac{2 b^2 e n^2 x^r}{r^3}-\frac{2 b e n x^r \left (a+b \log \left (c x^n\right )\right )}{r^2}+\frac{e x^r \left (a+b \log \left (c x^n\right )\right )^2}{r}+\frac{d \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}\\ \end{align*}

Mathematica [A]  time = 0.143085, size = 109, normalized size = 1.36 \[ \frac{e x^r \left (a^2 r^2-2 a b n r+2 b^2 n^2\right )}{r^3}+a^2 d \log (x)+\frac{b \log ^2\left (c x^n\right ) \left (a d r+b e n x^r\right )}{n r}-\frac{2 b e x^r (b n-a r) \log \left (c x^n\right )}{r^2}+\frac{b^2 d \log ^3\left (c x^n\right )}{3 n} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^r)*(a + b*Log[c*x^n])^2)/x,x]

[Out]

(e*(2*b^2*n^2 - 2*a*b*n*r + a^2*r^2)*x^r)/r^3 + a^2*d*Log[x] - (2*b*e*(b*n - a*r)*x^r*Log[c*x^n])/r^2 + (b*(a*
d*r + b*e*n*x^r)*Log[c*x^n]^2)/(n*r) + (b^2*d*Log[c*x^n]^3)/(3*n)

________________________________________________________________________________________

Maple [C]  time = 0.279, size = 1712, normalized size = 21.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^r)*(a+b*ln(c*x^n))^2/x,x)

[Out]

I/r*Pi*ln(c)*b^2*e*csgn(I*c*x^n)^2*csgn(I*c)*x^r+I/r*Pi*ln(c)*b^2*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x^r+I/r*Pi*a*b
*e*csgn(I*c*x^n)^2*csgn(I*c)*x^r+I/r*Pi*a*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x^r-I/r^2*Pi*b^2*e*n*csgn(I*c*x^n)^2
*csgn(I*c)*x^r-I/r^2*Pi*b^2*e*n*csgn(I*x^n)*csgn(I*c*x^n)^2*x^r+1/2*I*Pi*b^2*d*n*csgn(I*x^n)*csgn(I*c*x^n)*csg
n(I*c)*ln(x)^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Pi^2*ln(x)*
b^2*d*csgn(I*x^n)*csgn(I*c*x^n)^3*csgn(I*c)^2+1/2*Pi^2*ln(x)*b^2*d*csgn(I*x^n)^2*csgn(I*c*x^n)^3*csgn(I*c)-1/4
*Pi^2*ln(x)*b^2*d*csgn(I*x^n)^2*csgn(I*c*x^n)^2*csgn(I*c)^2+I*Pi*ln(c)*ln(x)*b^2*d*csgn(I*c*x^n)^2*csgn(I*c)-I
/r*Pi*ln(c)*b^2*e*csgn(I*c*x^n)^3*x^r-I/r*Pi*a*b*e*csgn(I*c*x^n)^3*x^r-1/2*I*Pi*b^2*d*n*csgn(I*c*x^n)^2*csgn(I
*c)*ln(x)^2-1/2*I*Pi*b^2*d*n*csgn(I*x^n)*csgn(I*c*x^n)^2*ln(x)^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))^2/x,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.60679, size = 454, normalized size = 5.68 \begin{align*} \frac{b^{2} d n^{2} r^{3} \log \left (x\right )^{3} + 3 \,{\left (b^{2} d n r^{3} \log \left (c\right ) + a b d n r^{3}\right )} \log \left (x\right )^{2} + 3 \,{\left (b^{2} e n^{2} r^{2} \log \left (x\right )^{2} + b^{2} e r^{2} \log \left (c\right )^{2} + 2 \, b^{2} e n^{2} - 2 \, a b e n r + a^{2} e r^{2} - 2 \,{\left (b^{2} e n r - a b e r^{2}\right )} \log \left (c\right ) + 2 \,{\left (b^{2} e n r^{2} \log \left (c\right ) - b^{2} e n^{2} r + a b e n r^{2}\right )} \log \left (x\right )\right )} x^{r} + 3 \,{\left (b^{2} d r^{3} \log \left (c\right )^{2} + 2 \, a b d r^{3} \log \left (c\right ) + a^{2} d r^{3}\right )} \log \left (x\right )}{3 \, r^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))^2/x,x, algorithm="fricas")

[Out]

1/3*(b^2*d*n^2*r^3*log(x)^3 + 3*(b^2*d*n*r^3*log(c) + a*b*d*n*r^3)*log(x)^2 + 3*(b^2*e*n^2*r^2*log(x)^2 + b^2*
e*r^2*log(c)^2 + 2*b^2*e*n^2 - 2*a*b*e*n*r + a^2*e*r^2 - 2*(b^2*e*n*r - a*b*e*r^2)*log(c) + 2*(b^2*e*n*r^2*log
(c) - b^2*e*n^2*r + a*b*e*n*r^2)*log(x))*x^r + 3*(b^2*d*r^3*log(c)^2 + 2*a*b*d*r^3*log(c) + a^2*d*r^3)*log(x))
/r^3

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)*(a+b*ln(c*x**n))**2/x,x)

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [B]  time = 1.32681, size = 296, normalized size = 3.7 \begin{align*} \frac{1}{3} \, b^{2} d n^{2} \log \left (x\right )^{3} + \frac{b^{2} n^{2} x^{r} e \log \left (x\right )^{2}}{r} + b^{2} d n \log \left (c\right ) \log \left (x\right )^{2} + \frac{2 \, b^{2} n x^{r} e \log \left (c\right ) \log \left (x\right )}{r} + b^{2} d \log \left (c\right )^{2} \log \left (x\right ) + a b d n \log \left (x\right )^{2} + \frac{b^{2} x^{r} e \log \left (c\right )^{2}}{r} - \frac{2 \, b^{2} n^{2} x^{r} e \log \left (x\right )}{r^{2}} + \frac{2 \, a b n x^{r} e \log \left (x\right )}{r} + 2 \, a b d \log \left (c\right ) \log \left (x\right ) - \frac{2 \, b^{2} n x^{r} e \log \left (c\right )}{r^{2}} + \frac{2 \, a b x^{r} e \log \left (c\right )}{r} + a^{2} d \log \left (x\right ) + \frac{2 \, b^{2} n^{2} x^{r} e}{r^{3}} - \frac{2 \, a b n x^{r} e}{r^{2}} + \frac{a^{2} x^{r} e}{r} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))^2/x,x, algorithm="giac")

[Out]

1/3*b^2*d*n^2*log(x)^3 + b^2*n^2*x^r*e*log(x)^2/r + b^2*d*n*log(c)*log(x)^2 + 2*b^2*n*x^r*e*log(c)*log(x)/r +
b^2*d*log(c)^2*log(x) + a*b*d*n*log(x)^2 + b^2*x^r*e*log(c)^2/r - 2*b^2*n^2*x^r*e*log(x)/r^2 + 2*a*b*n*x^r*e*l
og(x)/r + 2*a*b*d*log(c)*log(x) - 2*b^2*n*x^r*e*log(c)/r^2 + 2*a*b*x^r*e*log(c)/r + a^2*d*log(x) + 2*b^2*n^2*x
^r*e/r^3 - 2*a*b*n*x^r*e/r^2 + a^2*x^r*e/r